package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.ISalesPlanDao;
import com.seal.dto.SalesPlanDto;
import com.seal.model.SalesPlan;
import com.seal.service.ISalesPlanService;

@Service("salesPlanServiceImpl")
@Transactional(readOnly = true)
public class SalesPlanServiceImpl implements ISalesPlanService {
	@Resource(name = "salesPlanDaoImpl")
	private ISalesPlanDao salesPlanDao;

	@Transactional(readOnly = false, rollbackForClassName = "Exception")
	public void addSalesPlan(SalesPlan ca) throws Exception {
		salesPlanDao.addSalesPlan(ca);
	}

	@Transactional(readOnly = false, rollbackForClassName = "Exception")
	public void deleteSalesPlan(SalesPlan ca) throws Exception {
		salesPlanDao.deleteSalesPlan(ca);
	}

	@Transactional(readOnly = false, rollbackForClassName = "Exception")
	public void updateSalesPlan(SalesPlan ca) throws Exception {
		salesPlanDao.updateSalesPlan(ca);
	}

	public List<SalesPlan> getAllSalesPlan(SalesPlanDto salesPlanDto, Page page, boolean addflag)
			throws Exception {
		return salesPlanDao.getAllSalesPlan(salesPlanDto,page,addflag);
	}

	public SalesPlan getSalesPlanById(Long id) throws Exception {
		return salesPlanDao.getSalesPlanById(id);
	}

}
